<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
<title>创建数据库 - 网家教育资讯管理系统</title>
  <link rel="stylesheet" href="/public/layui/css/layui.css">
  <script src="/public/layui/layui.js"></script>
  <script src="/public/js/jquery-3.4.1.min.js"></script>
<style>
* {
	margin:0;
	padding:0;
}
a{ text-decoration:none;}
 
.login-bg {

 
}
.content {
    width: 1080px;
    margin: 0 auto;
    margin-top: 50px;
    background: rgb(255, 255, 255);
    border-radius: 10px;
    padding: 10px 20px;
    box-sizing: border-box;
    box-shadow: 0 0 100px #bdb5b5;
}
@media screen and (max-width: 800px) { 
.content {
	
    width: 95%;
}
}

.title h2 {
	font-size:22px;
	line-height:60px;
	color:#333;
	font-weight:bold;
	text-align:center;
}
.p {
    font-size: 15px;
    line-height: 30px;
    color: #333;
}
.login-button {
	background-color:#1e90ff;
	height:50px;
	border-radius:5px;
	font-size:18px;
	color:#fff;
	text-align:center;
	line-height:50px;
	cursor:pointer;
}
.top {
    background-color: #000000;
    height: 200px;
    font-size: 30px;
    font-weight: bold;
    color: #fff;
    text-align: center;
    line-height: 200px;
}
.login-buttonz {
	background-color: #000000;
	height:50px;
	border-radius:5px;
	font-size:18px;
	color:#fff;
	text-align:center;
	line-height:50px;
	cursor:pointer;
	width: 45%;
	float: left;
}
.login-buttony {
	background-color: #000000;
	height:50px;
	border-radius:5px;
	font-size:18px;
	color:#fff;
	text-align:center;
	line-height:50px;
	cursor:pointer;
	width: 45%;
	float: right;
}
.clearfix:after {
    content: "";
    display: table;
    clear: both;
}
.login-buttonx {
    border: none;
    text-decoration: none;
    background-color: #1e90ff;
    height: 50px;
    border-radius: 5px;
    font-size: 18px;
    color: #fff;
    text-align: center;
    line-height: 50px;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
}
</style>
</head>
<body>
<div class="top">第三步: 创建数据库</div>
<div class="login-bg">
    <div class="content">
        <div class="title">
            <h2>创建数据库</h2>
        </div>
    	<div class="p">
		<form id="keydb" class="layui-form layui-form-pane" action="./index.php?c=success" method="post">
			<div class="layui-form-item">
				<label class="layui-form-label">数据库类型</label>
				<div class="layui-input-block">
					<input type="text" name="DB_TYPE" value="mysql" disabled="disabled" class="layui-input">
				</div>
			</div>
           <input type="text" style="display:none;" name="www" id="www">
			<div class="layui-form-item">
				<label class="layui-form-label">数据库服务器</label>
				<div class="layui-input-block">
					<input type="text" name="DB_HOST" value="127.0.0.1" required lay-verify="required" autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">数据库端口</label>
				<div class="layui-input-block">
					<input type="text" name="DB_PORT" value="3306" required lay-verify="required" autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">数据库名</label>
				<div class="layui-input-block">
					<input type="text" type="text" name="DB_NAME" required lay-verify="required" autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">数据库用户名</label>
				<div class="layui-input-block">
					<input type="text" name="DB_USER" value="root" required lay-verify="required" autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">数据库密码</label>
				<div class="layui-input-block">
					<input type="text" name="DB_PWD" required lay-verify="required" autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">数据库前缀</label>
				<div class="layui-input-block">
					<input type="text" name="DB_PREFIX" value="my_" required lay-verify="required" autocomplete="off" class="layui-input">
				</div>
			</div>
			<br><br>
        <div class="form-box">
            <a href="./index.php?c=test"><div class="login-buttonz">上一步</div></a>
            <a onclick="insert()" href="javascript:;"><div class="login-buttony">下一步</div></a>
            <div class="inout2" style="display:none;" id="bky">
			<input type="submit" onclick="insert()" lay-submit lay-filter="formDemo" class="login-buttonx" value="点击安装">
			</div>
        </div>
		</form>
		<div class="clearfix"></div>
 
      </div> 

    </div>
</div>
</body>
</html>
  
  <script type="text/javascript">    
    var www = window.location.host;  
    document.getElementById('www').value = www;  
    layui.use('form', function(){
      var form = layui.form();
    }); 
    function insert() {
      document.getElementById("bky").style.display = "inline";
      $.ajax({
        type: "POST", url: "<?php echo $url; ?>/api/sq/keywww.html" , 
        data: $('#keydb').serialize(),
      });
    }
  </script> 